package com.luoying.itew.http.rxjava;


import com.luoying.itew.http.BaseResponse;

import io.reactivex.Observable;
import io.reactivex.ObservableSource;
import io.reactivex.ObservableTransformer;
import io.reactivex.functions.Function;

/**
 * Created by lufan on 2019-04-29
 * Class describe 这里做返回结果分析处理 目前没有用到
 */
public class RxResultHelper {
    public static <T> ObservableTransformer<BaseResponse<T>,BaseResponse<T>> handleResult(){
        return new ObservableTransformer<BaseResponse<T>, BaseResponse<T>>() {
            @Override
            public ObservableSource<BaseResponse<T>> apply(Observable<BaseResponse<T>> upstream) {
                return upstream.flatMap(new Function<BaseResponse<T>, ObservableSource<BaseResponse<T>>>() {
                    @Override
                    public ObservableSource<BaseResponse<T>> apply(BaseResponse<T> tBaseResponse) throws Exception {
                        return null;
                    }
                });
            }
        };

    }
}
